When running phpcs, the following issues found:
FILE: /Users/tesboss/_PROJECTS/drupal/addtoany/addtoany.api.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
14 | ERROR | Type hint "array" missing for $types
----------------------------------------------------------------------
FILE: /Users/tesboss/_PROJECTS/drupal/addtoany/addtoany.module
---------------------------------------------------------------------------------------------------------------------------
FOUND 23 ERRORS AND 3 WARNINGS AFFECTING 20 LINES
---------------------------------------------------------------------------------------------------------------------------
18 | ERROR | [x] Function comment short description must start with exactly one space
20 | ERROR | [x] Expected 1 space before opening brace; found 0
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
22 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
23 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
24 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
25 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
27 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
28 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
29 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
29 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
30 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
31 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
32 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
32 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
32 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
32 | ERROR | [x] Concat operator must be surrounded by a single space
33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
34 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
35 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
38 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
38 | ERROR | [x] Closing brace indented incorrectly; expected 0 spaces, found 1
38 | ERROR | [x] Expected 1 blank line after function; 2 found
165 | ERROR | [ ] String concat is not required here; use a single string instead
312 | ERROR | [x] Use null coalesce operator instead of ternary operator.
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------
FILE: /Users/tesboss/_PROJECTS/drupal/addtoany/src/Form/AddToAnySettingsForm.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 7 WARNINGS AFFECTING 12 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
52 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
238 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
251 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
261 | WARNING | [ ] Line exceeds 80 characters; contains 98 characters
263 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
263 | WARNING | [ ] Only string literals should be passed to t() where possible
277 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
304 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
317 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
317 | ERROR | [ ] Description for the @return value is missing
322 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
330 | ERROR | [x] Expected 1 blank line after function; 0 found
331 | ERROR | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /Users/tesboss/_PROJECTS/drupal/addtoany/src/Plugin/views/field/NodeAddToAnyShare.php
-------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------
17 | ERROR | Missing short description in doc comment
24 | ERROR | Missing short description in doc comment
-------------------------------------------------------------------------------------------
FILE: /Users/tesboss/_PROJECTS/drupal/addtoany/src/Plugin/Block/AddToAnyBlock.php
----------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------
24 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
26 | WARNING | [ ] Node::load calls should be avoided in classes, use dependency injection instead
29 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
29 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
47 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------
Time: 426ms; Memory: 12MB
Comments
Comment #3
vladimirausAutomated fixes applied. Remaining issues
Comment #4
vladimirausDuplicate of #3329621: Coding standards and best practices.